<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>景点管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../../layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="../../css/public.css" media="all"/>
</head>
<body class="childrenBody">
<form class="layui-form linksAdd">

    <div class="layui-col-md8 layui-col-xs12">

        <div class="layui-row layui-col-space10">
            <div class="layui-col-md10 layui-col-xs7">
                <div class="layui-form-item magt3">
                    <label class="layui-form-label">标题</label>
                    <div class="layui-input-block">
                        <input type="text" class="layui-input title" lay-verify="required" placeholder="请输入标题">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">简介</label>
                    <div class="layui-input-block">
                        <textarea class="layui-textarea brief_desc" lay-verify="required"  placeholder="请输入简介"
                                  style="padding-right: 20px"></textarea>
                    </div>
                </div>
            </div>
            <div class="layui-col-md2 layui-col-xs5">
                <div class="layui-upload-list thumbBox mag0 magt3">
                    <input type="hidden" id="img_url1" name="LogoSrc" value=""/>
                    <div id="test1">
                        <img id="img_demo" class="small_img"/>
                        <p id="demoText"></p>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item magb0">
            <label class="layui-form-label">详情</label>

            <div id="editor" id="content" class="layui-input-block"></div>


        </div>

    </div>

    <div class="layui-col-md4 layui-col-xs12" style="padding-left:20px;">
        <blockquote class="layui-elem-quote"><i class="seraph icon-caidan"></i> 基础信息</blockquote>
        <div class="border category">
            <div class="">
                <div class="layui-form-item" style="display: none">
                    <label class="layui-form-label">ID</label>
                    <div class="layui-input-block">
                        <input type="text" class="layui-input id" readonly placeholder="景点ID"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">景点评分</label>
                    <div class="layui-input-block">
                        <input type="text" class="layui-input score" lay-verify="required"  placeholder="请输入评分"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">起始价格</label>
                    <div class="layui-input-block">
                        <input type="text" class="layui-input price_start" placeholder="请输入起始价格如果0免费"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">景区分类</label>
                    <div class="layui-input-block">
                        <!--<input type="text" class="layui-input spot_type"  placeholder="请输入景点对应的分类id"/>-->
                        <select name="productList" id="zcySelect">
                        </select>

                    </div>

                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">客服电话</label>
                    <div class="layui-input-block">
                        <input type="text" class="layui-input customtel" placeholder="请输入客服电话"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">景区地址</label>
                    <div class="layui-input-block">
                        <input type="text" class="layui-input address" placeholder="请输入地址"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">开放时间</label>
                    <div class="layui-input-block">
                        <input type="text" class="layui-input opentime" placeholder="开放时间"/>
                    </div>
                </div>
                <!--                <div class="layui-form-item">
                                    <label class="layui-form-label">预览图片地址</label>
                                    <div class="layui-input-block">
                                         <img src="" class="layui-upload-img small_img">
                                        <input type="text" class="layui-input small_img"  placeholder="预览图图片地址"/>
                                    </div>
                                </div>-->


                <!--<div class="layui-form-item">-->
                <!--<label class="layui-form-label">Logo</label>-->
                <!--<div class="layui-input-block">-->
                <!--<button type="button" class="layui-btn" id="test1">上传图片</button>-->
                <!--<input type="hidden" id="img_url1" name="LogoSrc" value=""/>-->
                <!--<div class="layui-upload-list">-->
                <!--<img class="layui-upload-img small_img" width="100px" height="80px" id="demo1"/>-->
                <!--<p id="demoText"></p>-->
                <!--</div>-->
                <!--</div>-->
                <!--</div>-->
                <!--            <label class="layui-form-label">预览图片</label>
                              <div class="layui-upload-list thumbBox mag0 magt3" style="width:100px;height:100px;">
                                <img src="" class="layui-upload-img small_img" style="width:100px;height:100px;">
                            </div>
                              </div>-->


                <div class="layui-form-item">
                    <label class="layui-form-label">标签</label>
                    <div class="layui-input-block">
                        <input type="text" class="layui-input tag" placeholder="请用逗号隔开“,”"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">排序</label>
                    <div class="layui-input-block">
                        <input type="text" class="layui-input sort" placeholder="排序"/>
                    </div>
                </div>
                <!--<div class="layui-form-item">-->
                <!--<label class="layui-form-label">状态</label>-->
                <!--<div class="layui-input-block">-->
                <!--<input type="text" class="layui-input status_id" placeholder="状态"/>-->
                <!--</div>-->
                <!--</div>-->
                <div class="layui-form-item" style="text-align:center;line-height:50px">
                    <button class="layui-btn" style="width: 120px" lay-filter="addLink" lay-submit>提交</button>
                </div>
            </div>
        </div>


    </div>


</form>
<script type="text/javascript" src="../../layui/layui.js"></script>
<script type="text/javascript" src="spotViewList.js"></script>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
<script type="text/javascript" src="../../js/wangEditor.js"></script>
<script>
    var E = window.wangEditor;
    var editor = new E('#editor');
    // 或者 var editor = new E( document.getElementById('editor') )
    editor.customConfig.customUploadImg = function (files, insert) {
        // files 是 input 中选中的文件列表
        // insert 是获取图片 url 后，插入到编辑器的方法

        // 上传代码返回结果之后，将图片插入到编辑器中
        var formData = new FormData();
        formData.append("file", files[0]);
        $.ajax({
            url: public_url + 'public/?service=App.' + 'Examples_Upload' + '.Go',
            type: 'POST',
            data: formData,
            processData: false,
            contentType: false,
            success: function (data) {

                insert(data.data.url)
            },
            error: function (data) {
                console.log(data)
            }
        });
    };
    editor.create();

    function create_edi(valu) {
        editor.txt.html(valu)
    }

    //    layui.use('laydate',function () {
    //
    //        var laydate = layui.laydate;
    //        //执行一个laydate实例
    //        laydate.render({
    //            elem: '#opentime' //指定元素
    //        });
    //
    //
    //    });


</script>
</body>
</html>